#ifndef AST_DECLARATIONS_ENUM_SPECIFIER_H
#define AST_DECLARATIONS_ENUM_SPECIFIER_H

#include "../ASTNode.h"

class sym;
class EnumeratorList;
/*
C99   6.7.2.2
enum-specifier:
		enum    identifier(opt)    {   enumerator-lsit   }
		enum    identifier(opt)    {   enumerator-list   ,   }
		enum    identifier
*/
class EnumSpecifier : public ASTNode
{
protected:
	EnumSpecifier(void)
		: ASTNode(ASTNode::enum_specifier){};
public:
	EnumSpecifier(sym * pIdentifier)
		: ASTNode(ASTNode::enum_specifier)
		, m_pIdentifier(pIdentifier)
		, m_pEnumList(NULL){};
	EnumSpecifier(EnumeratorList * pEnumList, sym *pIdentifier = NULL)
		: ASTNode(ASTNode::enum_specifier)
		, m_pIdentifier(pIdentifier)
		, m_pEnumList(pEnumList){};

	virtual ~EnumSpecifier(void);

	virtual void						codeGen();

protected:
	sym *								m_pIdentifier;	// may be NULL
	EnumeratorList *					m_pEnumList;
};


#endif


